package bjut.core.config;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: zhuzhiming
 * @Date: 2022/4/10 19:02
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ProviderConfig {

    private String group;
    private String version;
    private Object service;

    public String getRpcServiceName() {
        return this.getServiceName() + "." + this.group + "." + this.version;
    }

    public String getServiceName() {
        //获取接口全类名
        return this.service.getClass().getInterfaces()[0].getCanonicalName();
    }

}
